home *** CD-ROM | disk | FTP | other *** search
- /
- / Copyright (C) 1990-1992 Michael Davidson.
- / All rights reserved.
- /
- / Permission to use, copy, modify, and distribute this software
- / and its documentation for any purpose and without fee is hereby
- / granted, provided that the above copyright notice appear in all
- / copies and that both that copyright notice and this permission
- / notice appear in supporting documentation.
- /
- / This software is provided "as is" without express or implied warranty.
- /
- .text
-
- .globl EnterV86Mode
-
- EnterV86Mode:
- push %ebp / save frame pointer
- movl %esp, %ebp / mark stack
- iret / enter V86 mode through TSS
- cmp %esp, %ebp / check for error code on stack
- jne err
- xor %eax, %eax / clear return value
- pop %ebp / restore frame pointer
- ret
-
- err: pop %eax / get error code
- mov %ebp, %esp / restore stack pointer
- pop %ebp / restore frame pointer
- ret
-